<?
//error_reporting(0);
//ini_set("display_errors", "off");



	define('ROOT_PATH',dirname(dirname(__FILE__)));
	define('CONF_PATH',ROOT_PATH.'/config');
	define('CONFOUTSYNC_PATH',ROOT_PATH.'/config_outsync');
	define('LIB_PATH',ROOT_PATH.'/lib');
	define('APP_PATH',ROOT_PATH.'/app');
	define('CACHE_PATH',ROOT_PATH.'/cache');
	define('UPLOAD_PATH',ROOT_PATH.'/www/upload');
	define('LOG',ROOT_PATH.'/logs');
	define('WWW_PATH',ROOT_PATH.'/www');
	define('MODEL_PATH',APP_PATH.'/Model');
	define('VIEW_PATH',APP_PATH.'/View');
	define('BACKEND_PATH',ROOT_PATH.'/backend');
	define('IMOREDB','imore2');
        define('IMOREBLOGDB','imore_blog');

	if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'){
		define('HTTPS_',"https://");
	}else{
		define('HTTPS_',"http://");
	}
	
	define('DOMAIN',HTTPS_."test.itrial.hk/");
	define('IMOREDOMAIN',HTTPS_."www2.imore.hk/");
	define('SUPERUSER',"1718");

	//facebook
	define('FB_APPID','334435949996746');
	define('FB_SECRET','8a400976b4b38ae5e480175c4caaf328');
	define('FB_SCOPE','publish_stream,user_photos,email,offline_access,user_birthday,user_notes');
	define('FB_REDIRECT_URI','http://test.itrial.hk');
	define('FB_COOKIE',true);
	define('FB_FILEUPLOAD_SUPPORT',true);

	//weibo
	define('WB_AKEY','3796249214');
	define('WB_SKEY','649de2d02a2a73ee088ae45294ca7a44');

	//upload
	define('UPLOAD_MAX_WIDTH',1280);//最大寬�?280
	define('UPLOAD_MAX_HEIGHT',1280);//最大高�?280

	//ucenter
	define('UC_AVATAR_PATH',WWW_PATH.'/forum/');
    
	$inc_path = array(
						LIB_PATH,
						CONF_PATH,
						CONFOUTSYNC_PATH,
						LIB_PATH.'/Common',
						LIB_PATH.'/Db',
						LIB_PATH.'/Session',
						LIB_PATH.'/Upload',
						LIB_PATH.'/KVCache',
					);
	set_include_path(get_include_path() . PATH_SEPARATOR. implode(PATH_SEPARATOR, $inc_path));

	/** Cache expire */
	define('KVC_EXPIRE',600);
	define('KVC_EXPIRE_fg',5*60*60);
	
	/** core class */
	require_once('Config.php');
	require_once('lang.php');
	require_once('DbConfig.php');
	require_once('Config_outsync.php');
	require_once('Cgiapp.class.php');
	require_once('CGIApplication.class.php');
	require_once('CGIApplication/Pagelist.class.php');
	require_once('CommonUtil.php');
	require_once('SiteFunction.php');
	require_once('HTMLComponent.php');
	require_once('Db.class.php');
	require_once('DbFunction.php');
	require_once('KVCacheConfig.php');
	require_once('KVCache.class.php');	
	require_once('DBI.class.php');
	require_once('dbUtil.php'); 
	require_once('I18N.php');
	require_once('Session.class.php');
	require_once('Site.class.php');
	require_once('ImgConfig.php');
	require_once(MODEL_PATH.'/Model.php');

	ini_set('display_errors','on');	# 顯示錯誤
?>